import { Equal, Expect } from "@type-challenges/utils";
// 元组转集合
// type TupleToUnion<T extends unknown[]> = T extends [infer F, ...infer R]
//   ? F | TupleToUnion<R>
//   : never;

type TupleToUnion<T extends any[]> = T[number];

type cases = [
  Expect<Equal<TupleToUnion<[123, "456", true]>, 123 | "456" | true>>,
  Expect<Equal<TupleToUnion<[123]>, 123>>
];
